package vocabularyhub.word.impl;

import vocabularyhub.word.model.IWord;

public class SimplestWord implements IWord {

    String word;

    public SimplestWord(String word) {
        this.word = word;

    }

    @Override
    public String getWord() {
        return word;
    }

    @Override
    public void setWord(String word) {
        this.word = word;
    }

    public boolean equals(Object o) {
        if (this.word == null) {
            return ((IWord) o).getWord() == null;
        }
        return word.equals(((IWord) o).getWord());
    }

    public String toString() {
        return word;
    }

    @Override
    public int compareTo(IWord anotherWord) {
        return this.word.compareTo(anotherWord.getWord());
    }

}
